-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: prometheus: don't poll the same tag multiple times #10450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm, needs testing of the integration so some prometheus users requested for verification.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10450 +/- ##
=========================================
Coverage 15.99% 15.99%
+ Complexity 13081 13080 -1
=========================================
Files 5649 5649
Lines 495648 495648
Branches 60006 60006
=========================================
Hits 79265 79265
Misses 407537 407537
Partials 8846 8846
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12550 |
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-12572)
|
Description
This PR speeds up Prometheus exporter reply generation by ensuring the same host tag is not polled multiple times.
It utilizes
HashSetinstead ofArrayListto store the host tags, therefore deduplicates the tags when they are present on multiple hosts.It fixes two bugs:
cloudstack_vms_total_by_tag{filter="<vm state>", zone="<zonename>", tags="<tagname>"}in the reply.Steps to reproduce
time curl http://<cs.server.ip>:<prometheus.port>/metricsfrom the prometheus exporter port. Inspect the reply, and note the time it took to finish.Expected behavior:
cloudstack_vms_total_by_tag{filter="<vm state>", zone="<zonename>", tags="<tagname>"}shall not be duplicated in the reply.Actual behavior:
cloudstack_vms_total_by_tagmetrics with the same labels are not uniqueTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?